package net.mingsoft.dashboard.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.mingsoft.dashboard.action.q.collection.CollectionListQuery;
import net.mingsoft.dashboard.action.q.collection.CollectionModifyQuery;
import net.mingsoft.dashboard.action.r.CollectionDirResponse;
import net.mingsoft.dashboard.action.r.FileCollectionResponse;
import net.mingsoft.dashboard.entity.collection.FileCollectionEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author gengfa
 * @date 22/02/10
 */
public interface CollectionDao {

    int insertOne(@Param("query")FileCollectionEntity entity);

    int updateName(@Param("query")CollectionModifyQuery query);

    int updateStatus(@Param("id") long id, @Param("status") String status);

    FileCollectionEntity selectByName(@Param("name") String name, @Param("userId") long userId);

    /**
     * 查询用户所有搜藏加
     * @param userId 用户ID
     * @return 收藏夹列表
     */
    List<CollectionDirResponse> selectAllDir(@Param("userId") long userId);

    Page<FileCollectionEntity> selectListByUserId(@Param("page") Page<?> page,
                                                  @Param("userId") long userId,
                                                  @Param("query") CollectionListQuery query);

    Page<FileCollectionResponse> selectStarFileListByUserId(@Param("page") Page<?> page,
                                                            @Param("userId") long userId,
                                                            @Param("query") CollectionListQuery query);
}
